home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compendium Deluxe 2
/
LSD and 17bit Compendium Deluxe - Volume II.iso
/
a
/
prog
/
asmsrc
/
mischards.lha
/
SourceCode
/
Grid.s
< prev
next >
Wrap
Text File
|
1980-02-20
|
4KB
|
264 lines
Opt c-
Section "Base Code",Code_c
GridBase = $70000
GridCopper1 = GridBase+$3a00
GridCopper2 = GridBase+$5240
IncDir Df0:
Start Movem.l d0-d7/a0-a6,-(sp)
Bsr KillSys
Lea HardWare,a6
Move.w #$83c0,DMACon(a6)
Move.l #GridBase,a0
Move.l OldCop1(pc),a1
Bsr GridSeg+$20 ; Setup Grid and Copper
Loop Bsr VBL
Lea CopperCols(pc),a0 ; Give Palette to Gridder
Lea XYData(pc),a1
Bsr GridSeg+$22
Move.w #1,d0
Move.w #2,d1
Move.w #1,d2
Move.w #2,d3
Move.w #1,d4
Lea XYData(pc),a1
Add.w d0,00(a1)
Sub.w d0,02(a1)
Add.w d1,04(a1)
Sub.w d1,06(a1)
Add.w d2,08(a1)
Sub.w d2,10(a1)
Add.w d3,12(a1)
Sub.w d3,14(a1)
Add.w d4,16(a1)
Sub.w d4,18(a1)
And.w #$7f,00(a1)
And.w #$7f,02(a1)
And.w #$7f,04(a1)
And.w #$7f,06(a1)
And.w #$7f,08(a1)
And.w #$7f,10(a1)
And.w #$7f,12(a1)
And.w #$7f,14(a1)
And.w #$7f,16(a1)
And.w #$7f,18(a1)
Btst #6,$Bfe001
Bne Loop
Bsr GridSeg+$24 ; Release Copper
Bsr ReturnSys
Movem.l (sp)+,d0-d7/a0-a6
Moveq #0,d0
Rts
VBL Move.l $Dff004,d0
And.l #$1ff00,d0
Cmp.l #$13000,d0
Bne VBL
Rts
KillSys Bsr.s SysWait
Move.l $4,a6
Lea GFXName(pc),a1
Moveq #0,d0
Jsr -552(a6)
Lea OldCop1(pc),a5
Move.l $26(a0),$0(a5)
Move.l $32(a0),$4(a5)
Lea HardWare,a6
Move.w IntEnaR(a6),d0
Move.w DMAConR(a6),d1
Or.w #$8000,d0
And.w #$03ff,d1
Or.w #$8000,d1
Move.w d0,$8(a5)
Move.w d1,$a(a5)
Move.w #$7fff,IntEna(a6)
Move.w #$7fff,DMACon(a6)
Rts
SysWait Move.w #15,d7
SysWaitLoop Move.l #$05000,d1
Bsr.s WaitVBL
Bsr.s DoWaitVBL
Dbf d7,SysWaitLoop
Rts
DoWaitVBL Move.l #$03000,d1
WaitVBL Movem.l d0-d1/a6,-(sp)
Lea HardWare,a6
WaitVBLLoop Move.l VPosR(a6),d0
And.l #$1ff00,d0
Cmp.l d1,d0
Bne.s WaitVBLLoop
Movem.l (sp)+,d0-d1/a6
Rts
ReturnSys Lea HardWare,a6
Move.w OldIntEna(pc),IntEna(a6)
Move.w OldDMACon(pc),DMACon(a6)
Move.l OldCop1(pc),Cop1lc(a6)
Move.l OldCop2(pc),Cop2lc(a6)
Rts
GFXName Dc.b "graphics.library",0
Even
OldCop1 Dc.l 0
OldCop2 Dc.l 0
OldIntEna Dc.w 0
OldDmaCon Dc.w 0
XYData Dc.w 00,40
Dc.w 10,30
Dc.w 20,20
Dc.w 30,10
Dc.w 40,00
CopperCols Dc.w $180,$000,$182,$111,$184,$222,$186,$333
Dc.w $188,$444,$18a,$555,$18c,$666,$18e,$777
Dc.w $190,$888,$192,$aaa,$194,$bbb,$196,$ccc
Dc.w $198,$ddd,$19a,$eee,$19c,$fff,$19e,$fef
Dc.w $1a0,$fdf,$1a2,$fcf,$1a4,$fbf,$1a6,$faf
Dc.w $1a8,$f9f,$1aa,$f8f,$1ac,$f7f,$1ae,$f6f
Dc.w $1b0,$f5f,$1b2,$f4f,$1b4,$f3f,$1b6,$f2f
Dc.w $1b8,$f1f,$1ba,$f0f,$1bc,$e0e,$1be,$d0d
GridSeg Incbin Gridder-Seg
****Custom Chip Registers****
Hardware = $Dff000
;Control Registers
Dmaconr = $002
Vposr = $004
Vhposr = $006
Joy0dat = $00A
Joy1dat = $00C
Clxdat = $00E
Intenar = $01C
Intereqr = $01E
Copcon = $02E
;Blitter Registers
Bltcon0 = $040
Bltcon1 = $042
Bltafwm = $044
Bltalwm = $046
Bltcpth = $048
Bltcptl = $04A
Bltbpth = $04C
Bltbptl = $04E
Bltapth = $050
Bltaptl = $052
Bltdpth = $054
Bltdptl = $056
Bltsize = $058
Bltcmod = $060
Bltbmod = $062
Bltamod = $064
Bltdmod = $066
Bltcdat = $070
Bltbdat = $072
Bltadat = $074
;Copper Registers
Cop1lc = $080
Cop1lch = $080
Cop1lcl = $082
Cop2lc = $084
Cop2lch = $084
Cop2lcl = $086
Copjmp1 = $088
Copjmp2 = $08A
Diwstrt = $08E
Diwstop = $090
Ddfstrt = $092
Ddfstop = $094
Dmacon = $096
Clxcon = $098
Intena = $09A
Intreq = $09C
;BitPlane Registers
BplCon0 = $100
BplCon1 = $102
BplCon2 = $104
BplMod1 = $108
BplMod2 = $10a
BplPt0h = $0e0
BplPt0l = $0e2
BplPt1h = $0e4
BplPt1l = $0e6
BplPt2h = $0e8
BplPt2l = $0ea
BplPt3h = $0ec
BplPt3l = $0ee
BplPt4h = $0f0
BplPt4l = $0f2
BplPt5h = $0f4
BplPt5l = $0f6
;Colour Registers
Color00 = $180
Color01 = $182
Color02 = $184
Color03 = $186
Color04 = $188
Color05 = $18a
Color06 = $18c
Color07 = $18e
Color08 = $190
Color09 = $192
Color10 = $194
Color11 = $196
Color12 = $198
Color13 = $19a
Color14 = $19c
Color15 = $19e
Color16 = $1a0
Color17 = $1a2
Color18 = $1a4
Color19 = $1a6
Color20 = $1a8
Color21 = $1aa
Color22 = $1ac
Color23 = $1ae
Color24 = $1b0
Color25 = $1b2
Color26 = $1b4
Color27 = $1b6
Color28 = $1b8
Color29 = $1ba
Color30 = $1bc
Color31 = $1be
EcsNop = $1fe